package com.lifeng.zk.zkclient.watch;

import org.I0Itec.zkclient.IZkChildListener;

import java.util.List;

/**
 * Created by lifeng on 2018/6/14.
 * 订阅子节点的信息改变（监听当前节点以及子节点增加或者删除）(孙节点不监听)
 */
public class MyChildWatcher implements IZkChildListener{
    //parentPath：对应的父节点的路径
    //currentChilds：子节点的相对路径
    public void handleChildChange(String parentPath, List<String> currentChilds) throws Exception {
        System.out.println("父节点:"+parentPath);
        System.out.println("子节点:"+currentChilds.toString());
    }
}
